package webserver

type Config struct {
    Address string `ini:"address" comment:"服务器地址"`
    RunMode string `ini:"run_mode" comment:"运行模式"`

    RedisAddr string `ini:"redis_addr" comment:"redis服务器地址"`
    RedisUser string `ini:"redis_user" comment:"redis用户名"`
    RedisPass string `ini:"redis_pass" comment:"redis密码"`
    RedisDB   int    `ini:"redis_db" comment:"redis数据库"`

    SessionHashKey  string `ini:"session_hashkey"`
    SessionBlockKey string `ini:"session_blockkey"`

    JWTRealm string `ini:"jwt_realm" comment:""`
    JWTKey   string `ini:"jwt_key"`

    CSRFKey string `ini:"csrf_key" comment:"csrf密钥32字节"`
}

func DefaultConfig() *Config {
    return &Config{
        Address: "0.0.0.0:3000",
        RunMode: "product",

        RedisAddr: "127.0.0.1:6379",
        RedisUser: "",
        RedisPass: "123456",
        RedisDB:   1,

        SessionHashKey:  "authkey123",
        SessionBlockKey: "enckey12341234567890123456789012",

        JWTRealm: "WebServer",
        JWTKey:   "abbcddss",

        CSRFKey: "1234567890abcdef1234567890abcdef",
    }
}
